package com.easytopit.demo.spring.mvc.controller;

import java.io.IOException;
import java.net.URL;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;

@Configuration // 配置启动
public class App {

	public static void main(String[] args) throws IOException {
		// 上下环境: 运行环境
		ApplicationContext context = new AnnotationConfigApplicationContext(App.class);
		// 查找class path中所有的标签库
		Resource[] resources = context.getResources("classpath*:**/*.ftl");
		for (Resource r : resources) {
			URL url = r.getURL();
			String path = url.getPath();
			System.out.println(path);
		}
	}
}
